// pages/CustomizeCmpt/CmptCommunications/parent.js
Component({
  data: {
    checked: true,
    modelChecked: true,
  },
  methods: {
    childChangeValue() {
      console.log('Parent-checked', this.data.checked)
      console.log('Parent-modelChecked', this.data.modelChecked)
    },
    parentChangeValue() {
      this.setData({
        checked: !this.data.checked,
        modelChecked: !this.data.modelChecked
      })
    },
    onCmptEvent(event) {
      console.log(event)
      console.log(event.detail) // {username: "syx", passwaord: "********"}
    },
    cmptInstance() {
      const childIns = this.selectComponent('.child-instance');
      console.log(childIns)
      console.log(childIns.data) // {childData: "childData", childProp: "childProp", checked: true}
      childIns.childMethod() // childMethod
    }
  }
})
